from . import flutter

TextStyle = flutter.TextStyle
Container = flutter.Container
Center = flutter.Center
Text = flutter.Text
Stack = flutter.Stack
Positioned = flutter.Positioned
Transform = flutter.Transform
LinearGradient = flutter.LinearGradient
Colors = flutter.Colors
TextAlign = flutter.TextAlign
EdgeInsets = flutter.EdgeInsets
FontWeight = flutter.FontWeight
FontStyle = flutter.FontStyle
BoxShadow = flutter.BoxShadow
BoxShape = flutter.BoxShape
RichText = flutter.RichText
TextSpan = flutter.TextSpan
TextOverflow = flutter.TextOverflow
BorderRadius = flutter.BorderRadius
Offset = flutter.Offset
Scaffold = flutter.Scaffold
AppBar = flutter.AppBar
IconButton = flutter.IconButton
Icon = flutter.Icon
Icons = flutter.Icons
#
MaterialBanner = flutter.MaterialBanner
# CircleAvatar = flutter.CircleAvatar
FlatButton = flutter.FlatButton
Children = flutter.Children

#
def banner():
    return Scaffold(
        appBar=AppBar(
            title=Text('Banners'),
            leading=Icon(Icons.menu),
            actions=[
                Icon(Icons.favorite),
                Container(
                    padding=EdgeInsets.symmetric(16),
                    child=Icon(Icons.search),
                ),
                Icon(Icons.more_vert),
            ],
        ),
        body=Center(
            children=[
                MaterialBanner(
                    content=Text('Your password was updated on your other device. Please sign in again.'),
                    leading=Icon(Icons.error_outline),
                    actions=[
                        FlatButton(
                            child=Text('CONTINUE AS A GUEST'),
                            onPressed=None,
                            href='http://localhost:8000/web/_main_.html',
                        ),
                        FlatButton(
                            child=Text('SIGN IN'),
                            onPressed=None,
                            href='textfields.html',
                        ),
                    ],
                ),
            ]
        ),
    )


def run_app():
    test_ = banner()
    javascript.document.body.appendChild(test_.render())

run_app()